package com.ljf.finance.api.service.impl;

import com.ljf.common.api.service.impl.BasisServiceImpl;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ServiceResultModel;
import com.ljf.common.utils.ServiceResultUtil;
import com.ljf.finance.domain.repository.FinanceDatAccountReportTypeRepository;
import com.ljf.finance.domain.service.FinanceDatAccountReportTypeDomainService;
import com.ljf.finance.domain.validator.FinanceDatAccountReportTypeValidator;
import com.ljf.finance.dto.command.FinanceDatAccountReportTypeCommand;
import com.ljf.finance.dto.query.FinanceDatAccountReportTypeQuery;
import com.ljf.finance.model.FinanceDatAccountReportType;
import com.ljf.finance.service.IFinanceDatAccountReportTypeService;
import com.ljf.finance.vo.FinanceDatAccountReportTypeReportDataVO;
import com.ljf.finance.vo.FinanceDatAccountReportTypeVO;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * 账户报表类型  服务接口实现
 *
 * @author LJF
 * @since 2024-12-07
 */
@Service
public class FinanceDatAccountReportTypeServiceImpl extends BasisServiceImpl<FinanceDatAccountReportTypeDomainService, FinanceDatAccountReportTypeValidator, FinanceDatAccountReportTypeRepository, FinanceDatAccountReportTypeQuery, FinanceDatAccountReportTypeVO, FinanceDatAccountReportType, FinanceDatAccountReportTypeCommand> implements IFinanceDatAccountReportTypeService {

    /**
     * 报表数据
     *
     * @param code
     * @return
     * @throws ServiceException
     */
    @Override
    public ServiceResultModel<FinanceDatAccountReportTypeReportDataVO> reportData(String code) throws ServiceException {
        validator.checkReportData(code);
        FinanceDatAccountReportTypeReportDataVO result = domainService.reportData(code);
        List<FinanceDatAccountReportTypeReportDataVO> resultList = new ArrayList<>();
        resultList.add(result);
        return ServiceResultUtil.success(resultList);
    }

}
